<template>
  <div class="granary-list-item-type-three" @click="goToHomeItem(id)">
    <div class="index" :class="[index < 3 ? 'act' : '']">
      <div>{{num}}</div>
      <div v-if="index<3" class="no">No.</div>
    </div>
    <div class="left-img">
      <van-image width="65px" height="65px" radius="15" lazy-load fit="cover" :src="orign" />
    </div>

    <div class="right-text">
      <div class="title">
        <div v-html="digest"></div>
      </div>
      <div class="tag">
        <span>#{{tag}}</span>
      </div>
      <div class="foot">
        <div class="user">
          <div class="user-img">
            <img :src="bigAvaImg" />
          </div>
          <div class="user-text">{{blogNickName}}</div>
        </div>
        <div class="hot">{{hotCount}}热度</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "GranaryListItemTypeThree", //粮仓列表item
  props: [
    "index",
    "bigAvaImg",
    "blogNickName",
    "hotCount",
    "digest",
    "orign",
    "tag",
    "id",
    "goToHomeItem"
  ],
  mounted() {
    // console.log(this.moduleName);
  },
  computed: {
    num() {
      return this.index + 1;
    }
  }
};
</script>

<style lang="scss" scoped>
.granary-list-item-type-three {
  width: 96vw;
  margin: 10px auto;
  display: flex;

  .index {
    width: 10px;
    color: #cdcdcd;
    word-break: break-all;
    display: flex;
    flex-flow: column wrap;
    justify-content: center;
    align-items: center;

    .no {
      width: 30px;
      text-align: center;
      font-size: 12px;
    }
  }
  .act {
    width: 30px;
    color: #1dc6bf;
  }

  .left-img {
    width: 75px;
    height: 75px;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .right-text {
    margin-left: 10px;

    .title {
      div {
        height: 16px;
        overflow: hidden;

        ::v-deep p {
          font-weight: bolder;
          width: 55vw;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }
      }
    }

    .tag {
      margin: 7px 0 13px 0;
      span {
        padding: 3px 6px;
        font-size: 12px;
        color: #bfbfbf;
        border-radius: 10px;
        background-color: #f5f5f5;
      }
    }

    .foot {
      display: flex;
      align-items: center;

      .user {
        display: flex;
        align-items: center;

        .user-img {
          img {
            width: 20px;
            height: 20px;
            border-radius: 999px;
            margin-right: 3px;
          }
        }
      }

      .user-text,
      .hot {
        max-width: 120px;
        margin-right: 20px;
        font-size: 12px;
        color: #bfbfbf;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
      }
    }
  }
}
</style>